package com.zhuozhou.jdyc.base;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.zhuozhou.jdyc.api.ConstantsHelper;
import com.zhuozhou.jdyc.api.UserAccountHelper;
import com.zhuozhou.jdyc.bean.base.PageBean;
import com.zhuozhou.jdyc.main.goods.bean.TiHuoBase;

import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by fz on 2020/12/17 16:23
 * describe:
 */
public class BaseRecyclerViewModel<BV extends BaseView, T> extends BaseViewModel<BV> {

    public BaseRecyclerViewModel(@NonNull Application application) {
        super(application);
    }

//    public MutableLiveData<PageBean<T>> listLiveData = new MutableLiveData<>();


    //timetable/Basics/tihuo
    public MutableLiveData<List<TiHuoBase>> listLiveData = new MutableLiveData<>();

    public void getTiHuo(String commodity_id, int pages) {
        Map map = new HashMap();
        map.put("commodity_id", commodity_id);
        map.put("pages", pages);
        map.put("x", UserAccountHelper.getCoordinates().getLatitude());
        map.put("y", UserAccountHelper.getCoordinates().getLongitude());
        observe(apiServiceHelper.getTiHuo(map), true, listLiveData);
    }

}
